#include "ClientPlayerManager.h"

ClientPlayerManager::ClientPlayerManager()
{

}

void ClientPlayerManager::Draw()
{

}

void ClientPlayerManager::Update()
{
	for (auto it = m_clients.begin(); it != m_clients.end(); ++it)
	{
		it->second.pos += it->second.vel;
		it->second.vel *= 0.99f;
	}
}

void ClientPlayerManager::AddClient(int id, ClientInfo info)
{
	m_clients[id] = info;
}

void ClientPlayerManager::SetClientPos(int id, const D3DXVECTOR3& pos)
{
	m_clients.find(id)->second.pos = pos;
}

D3DXVECTOR3 ClientPlayerManager::GetClientPos(int id) const
{
	return m_clients.find(id)->second.pos;
}

void ClientPlayerManager::SetClientVel(int id, const D3DXVECTOR3& vel)
{
	m_clients.find(id)->second.vel = vel;
}

D3DXVECTOR3 ClientPlayerManager::GetClientVel(int id) const
{
	return m_clients.find(id)->second.vel;
}